import socket               
 
s = socket.socket()        
host = socket.gethostname()       
port = 8000                
s.bind((host, port))       
 
s.listen(5)                
while True:
    c,addr = s.accept()
    buf = c.recv(1024)
    buf = buf.decode()     
    print 'addr is', addr
    print 'value is ',buf   
    c.send('hello ')
    c.close()                
